
# 需要读写各种不同编码的文本数据，比如ASCII，UTF-8或UTF-16编码等
def demo_1():
    with open('../temp/pome.txt') as f:
        data = f.read()
        print(data)
        f.close()

def demo_2():
    with open('../temp/pome.txt', 'rt', encoding='latin-1') as f:
        data = f.read()
        print(data)
        f.close()

def demo_3():
    with open('../temp/pome.txt', 'rt', encoding='ascil') as f:
        data = f.read()
        print(data)
        f.close()

if __name__ == '__main__':
    # demo_1()
    demo_2()
    # demo_3()